import Vue from 'vue'
import Router from 'vue-router'


import home from '@/views/home.vue'
import home_index from '@/views/home-index.vue'
import home_search from '@/views/home-search.vue'
import myInfo from '@/views/myInfo.vue'
import accountInfo from '@/views/accountInfo.vue'
import myOrder from '@/views/myOrder.vue'
import GoodsInfo from '@/views/goodsinfo'
import Books from "@/views/book"
import Evaluate from "@/views/evaluate"
import Business from "@/views/business"
import SearchMall from "@/views/home-SearchMall"

import Login from '@/views/login.vue'
import register from '@/views/register.vue'
import About from '@/views/aboutEle.vue'
import topay from '@/views/topay.vue'
import Mypay from '@/views/mypay.vue'
import home_zhonghe from '@/views/home-zhonghe.vue'

Vue.use(Router)

var router = new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: home,
      redirect:'/home',
    },
    {
      path: '/home',
      name: 'home',
      component: home,
      redirect:'/home/home_index',
      children : [
        {
          path:'home_index',
          name:'home_index',
          component:home_index,
          redirect:'/home/home_index/zhonghe',
          children : [
            {
              path:'zhonghe',
              name:'zhonghe',
              component:home_zhonghe
            },
          ]
        },
        {
          path:'home_search',
          name:'home_search',
          component:home_search
        },
        {
          path:'home_myOrder',
          name:'home_myOrder',
          component:myOrder
        },
        {
          path:'home_myInfo',
          name:'home_myInfo',
          component:myInfo
        }
      ]
    },
    {
      path: '/accountInfo',
      name: 'accountInfo',
      component: accountInfo
    },
    {
      path: '/goodsinfo',
      name: 'goodsInfo',
      component: GoodsInfo,
      redirect:'/goodsinfo/book',
      children:[
        {
          path: 'book',
          name: 'book',
          component: Books
        },
        {
          path: 'evaluate',
          name: 'evaluate',
          component: Evaluate
        },
        {
          path: 'business',
          name: 'business',
          component: Business
        },
      ]
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/register',
      component: register
    },
    {
      path: '/about',
      component: About
    },
    {
      path: '/mypay',
      name: 'mypay',
      component: Mypay,
    },
    {
      path: '/topay',
      name: 'topay',
      component: topay,
    },
    {
      path: '/home-SearchMall',
      name: 'home-SearchMall',
      component: SearchMall
    },
  ]
})
export default router
